//
//  UserCenterViewController.m
//  Edutohome
//
//  Created by xiaofeifei on 15/1/13.
//
//

#import "UserCenterViewController.h"

@interface UserCenterViewController (){
    NSArray *_dataArray;
}

@end

@implementation UserCenterViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [_tableView setTableHeaderView:_headerView];
    [_tableView setTableFooterView:_footerView];
    
//    _dataArray = [NSArray arrayWithObjects:@"检查更新",@"修改密码",@"我要吐槽",@"关于", nil];
    
    // Do any additional setup after loading the view from its nib.
}

- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (IBAction)gotoUserInfoView:(id)sender{
//    UserInfoViewController *userInfo = [[UserInfoViewController alloc] initWithNibName:nil bundle:nil];
//    [(UINavigationController *)self.view.window.rootViewController pushViewController:userInfo animated:YES];
}

- (IBAction)logout {
//    [[GlobalData sharedGlobalData] setUserinfo:nil];
//    [[NSUserDefaults standardUserDefaults] setObject:nil forKey:@"_headerImg"];
//    [[NSUserDefaults standardUserDefaults] setObject:nil forKey:@"userinfo"];
//    [[NSUserDefaults standardUserDefaults] synchronize];
//    [[NSNotificationCenter defaultCenter] postNotificationName:@"alreadyLogin" object:nil];
    //    [[NSNotificationCenter defaultCenter] postNotificationName:@"HomeRefreshData" object:nil];
}


#pragma mark - Table View Delegate

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return _dataArray.count;
}

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
    return 20;
}

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{

    return 44;
}

// Customize the appearance of table view cells.
//- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
//{
//    static NSString *CellIdentifier = @"Cell";
//    
//    UserInfoCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
//    if (cell == nil) {
//        NSArray *array = [[NSBundle mainBundle] loadNibNamed:@"UserInfoCell" owner:self options:nil];
//        cell = (UserInfoCell *)[array objectAtIndex:0];
//    }
//    cell.nameLabel.text = _dataArray[indexPath.row];
//    cell.verNoLabel.hidden = YES;
//    [cell.arrawImg setImage:[UIImage imageNamed:@"list_narrow_right.png"]];
//    if ([cell.nameLabel.text isEqualToString:@"检查更新"]) {
//        cell.verNoLabel.hidden = NO;
//        cell.verNoLabel.text = [NSString stringWithFormat:@"当前版本：%@",[[GlobalData sharedGlobalData] userinfo].verNo];
//        [cell.arrawImg setImage:[UIImage imageNamed:@"list_refresh.png"]];
//    }
//    
//    return cell;
//}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
//    [tableView deselectRowAtIndexPath:indexPath animated:YES];
//    NSString *itemName = _dataArray[indexPath.row];
//
//    
//    UIViewController *vc = nil;
//    if ([itemName isEqualToString:@"修改密码"]) {
//        vc = [[ForgetPwdViewController alloc] initWithNibName:nil bundle:nil];
//    }
//    else if ([itemName isEqualToString:@"关于"]) {
//        vc = [[AboutUsViewController alloc] initWithNibName:nil bundle:nil];
//    }
//    else if ([itemName isEqualToString:@"检查更新"]) {
////        vc = [[AboutUsViewController alloc] initWithNibName:nil bundle:nil];
//        return;
//    }
//    else if ([itemName isEqualToString:@"我要吐槽"]) {
//        vc = [[UserFeedbackViewController alloc] initWithNibName:nil bundle:nil];
//    }
////    else if ([itemName isEqualToString:@"班级通知"]) {
////        vc = [[NewsListViewController alloc] initWithNibName:nil bundle:nil];
////    }
//    else {
//        return;
//    }
//    [(BasicViewController *)vc setNavStr:itemName];
//    [(UINavigationController *)self.view.window.rootViewController pushViewController:vc animated:YES];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
